﻿<script src="~/admui-13945148017-1592211513218/public/themes/global/js/components/bootstrap-datepicker.min.js"></script>
<script src="~/admui-13945148017-1592211513218/public/vendor/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
<script src="~/admui-13945148017-1592211513218/public/vendor/bootstrap-datepicker/bootstrap-datepicker.zh-CN.min.js"></script>
<link href="~/admui-13945148017-1592211513218/public/vendor/bootstrap-datepicker/bootstrap-datepicker.min.css" rel="stylesheet" />
<link href="~/admui-13945148017-1592211513218/public/css/css/zzsc.css" rel="stylesheet" />
<link href="~/admui-13945148017-1592211513218/public/css/starability-minified/starability-all.min.css" rel="stylesheet" />

<div id="nb" hidden="hidden" style="-webkit-animation: showSweetAlert .3s; animation: showSweetAlert .3s;margin-left:35%; text-align: center; position: fixed; bottom: 40%; border-top-left-radius: 20px; border-top-right-radius: 20px; border-bottom-left-radius: 20px; border-bottom-right-radius: 20px; z-index: 1 ">
    <img style="margin-left: 20px; margin-right: 20px; width: 250px; height: 200px;" src="~/GoTRI/img/1889835.gif" />
</div>

<div id="hetongid"></div>
<div id="div_XunJiaDanId" style="display: none;"></div>
<div class="page-container" id="admui-pageContent">
    <div class="page-header">
        <h1 class="page-title">人员信息</h1>
        <ol class="breadcrumb">
            <li class="breadcrumb-item">
                <a class="icon wb-home" href="javascript:;">人事</a>
            </li>
            <li class="breadcrumb-item active">人员信息</li>
            <a onclick="fanhui()" style="color:dodgerblue; font-size: 15px;">>>返回</a>
        </ol>
    </div>
    <div class="page animation-fade">
        <div class="page-content container-fluid">
            <div class="row">
                <div class="col-md-6" id="daxiaozhanshi">
                    <div class="panel">
                        <div class="page-header">
                        </div>
                        <div class="panel-body container-fluid" style="margin-top: -20px;">
                            <div class="row row-lg">
                                <div class="col-xl-12">
                                    <div class="example-wrap m-lg-0">
                                        <div class="nav-tabs-horizontal" data-approve="nav-tabs">
                                            <div class="tab-content pt-20" style="margin-top: -40px;">
                                                <div class="tab-pane active" id="exampleTabsLineTwo" role="tabpanel">
                                                    <div class="row row-lg">
                                                        <div class="col-md-12">
                                                            <div class="example-wrap">
                                                                <div class="example table-responsive">
                                                                    <table class="table table-bordered table-hover" style="width: 100%; text-align: center; margin-bottom: 0px;">
                                                                        <thead>
                                                                            <tr>
                                                                                <th colspan="4" style="text-align: center; font-size: 18px;">人&nbsp;员&nbsp;详&nbsp;细&nbsp;信&nbsp;息&nbsp;表&nbsp;格</th>
                                                                            </tr>
                                                                            <tr>
                                                                                <th>人员名称</th>
                                                                                <td colspan="3">
                                                                                    <div id="renyuanmingcheng"></div>
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <th style="width: 15%">性别</th>
                                                                                <td style="width: 35%">
                                                                                    <div id="xingbie"></div>
                                                                                </td>
                                                                                <th style="width: 15%">年龄</th>
                                                                                <td style="width: 35%">
                                                                                    <div id="nianling"></div>
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <th>联系方式</th>
                                                                                <td>
                                                                                    <div id="lianxifangshi"></div>
                                                                                </td>
                                                                                <th>公司名称</th>
                                                                                <td>
                                                                                    <div id="gongsimingcheng"></div>
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <th>部门名称</th>
                                                                                <td>
                                                                                    <div id="bumenmingcheng"></div>
                                                                                </td>
                                                                                <th>岗位名称</th>
                                                                                <td>
                                                                                    <div id="gangweimingcheng"></div>
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <th>战区名称</th>
                                                                                <td>
                                                                                    <div id="zhanqumingcheng"></div>
                                                                                </td>
                                                                                <th>
                                                                                    战队名称
                                                                                </th>
                                                                                <td>
                                                                                    <div id="zhanduimingcheng"></div>
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <th>所属战区总</th>
                                                                                <td>
                                                                                    <div id="shoushuzhanquzhong"></div>
                                                                                </td>
                                                                                <th>
                                                                                    所属部门总监
                                                                                </th>
                                                                                <td>
                                                                                    <div id="shoushubumenzongjian"></div>
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <th>入职时间</th>
                                                                                <td>
                                                                                    <div id="ruzhishijian"></div>
                                                                                </td>
                                                                                <th>
                                                                                    离职时间
                                                                                </th>
                                                                                <td>
                                                                                    <div id="lizhishijian"></div>
                                                                                </td>
                                                                            </tr>
                                                                        </thead>
                                                                    </table>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="panel-heading" name="xiaoshi" style="margin-top:-50px">
                            <h3 class="panel-title">星级</h3>
                        </div>
                        <div class="panel-body" name="xiaoshi">
                            <h4 class="example-title">星级打分</h4>
                            <div class="row">
                                <div class="form-group col-sm-1"></div>
                                <div class="form-group col-sm-5">
                                    <label class="control-label" for="inputBasicPassword">当前星级</label>
                                    <form>
                                        <fieldset class="starability-basic">
                                            <input type="radio" id="rate5-1" onclick="xingjiecchu(5)" name="rating" value="5" />
                                            <label for="rate5-1" onclick="xingjiecchu(5)" title="Amazing">5 stars</label>
                                            <input type="radio" onclick="xingjiecchu(4)" id="rate4-1" name="rating" value="4" />
                                            <label for="rate4-1" onclick="xingjiecchu(4)" title="Very good">4 stars</label>
                                            <input type="radio" onclick="xingjiecchu(3)" id="rate3-1" name="rating" value="3" />
                                            <label for="rate3-1" onclick="xingjiecchu(3)" title="Average">3 stars</label>
                                            <input type="radio" onclick="xingjiecchu(2)" id="rate2-1" name="rating" value="2" />
                                            <label for="rate2-1" onclick="xingjiecchu(2)" title="Not good">2 stars</label>
                                            <input type="radio" onclick="xingjiecchu(1)" id="rate1-1" name="rating" value="1" />
                                            <label for="rate1-1" onclick="xingjiecchu(1)" title="Terrible">1 star</label>
                                            <input type="radio" hidden="hidden" id="rate0-0" name="rating" value="1" />
                                            <label for="rate0-0" hidden="hidden" title="Terrible">0 star</label>
                                        </fieldset>
                                    </form>
                                </div>
                                <div class="form-group col-sm-3" style="padding-top:27px">
                                    <button type="button" id="baocuenshuju" class="btn btn-block btn-success" style="width: 95%; float: left;" onclick="baocuen()">保存</button>
                                </div>
                                <div class="form-group col-sm-3" style="padding-top:27px">
                                    <button typeutton" id="bt_ChongZhi" class="btn btn-outline btn-success" style="width: 95%;" onclick="ChongZhiXingJi();">重置</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-md-6" name="xiaoshi">
                    <div class="panel">
                        <div class="page-header">
                        </div>
                        <div class="panel-body container-fluid" style="margin-top: -20px;">
                            <div class="row row-lg">
                                <div class="col-xl-12">
                                    <div class="example-wrap m-lg-0">
                                        <div class="nav-tabs-horizontal" data-approve="nav-tabs">
                                            <div class="tab-content pt-20" style="margin-top: -40px;">
                                                <div class="tab-pane active" id="exampleTabsLineTwo" role="tabpanel">
                                                    <div class="row row-lg">
                                                        <div class="col-md-12">
                                                            <div class="example-wrap">
                                                                <div class="example table-responsive">
                                                                    <table class="table table-bordered table-hover" style="width: 100%; text-align: center; margin-bottom: 0px;">
                                                                        <thead>
                                                                            <tr>
                                                                                <th colspan="4" style="text-align: center; font-size: 18px;">销&nbsp;售&nbsp;信&nbsp;息</th>
                                                                            </tr>
                                                                            <tr name="xiaoshi">
                                                                                <th>总客户量</th>
                                                                                <td>
                                                                                    <div id="zongkehuliang"></div>
                                                                                </td>
                                                                                <th>
                                                                                    总带看量
                                                                                </th>
                                                                                <td>
                                                                                    <div id="zongdaikanliang"></div>
                                                                                </td>
                                                                            </tr>
                                                                            <tr name="xiaoshi">
                                                                                <th>总成交套数</th>
                                                                                <td>
                                                                                    <div id="zongchengjiaoshu"></div>
                                                                                </td>
                                                                                <th>
                                                                                    总销售额
                                                                                </th>
                                                                                <td>
                                                                                    <div id="zongxiaoshouer"></div>
                                                                                </td>
                                                                            </tr>
                                                                            <tr name="xiaoshi">
                                                                                <th>客户量</th>
                                                                                <td>
                                                                                    <div id="Benkehuliang"></div>
                                                                                </td>
                                                                                <th>
                                                                                    带看量
                                                                                </th>
                                                                                <td>
                                                                                    <div id="Bendaikanliang"></div>
                                                                                </td>
                                                                            </tr>
                                                                            <tr name="xiaoshi">
                                                                                <th>成交套数</th>
                                                                                <td>
                                                                                    <div id="Benchengjiaoshu"></div>
                                                                                </td>
                                                                                <th>
                                                                                    销售额
                                                                                </th>
                                                                                <td>
                                                                                    <div id="Benxiaoshouer"></div>
                                                                                </td>
                                                                            </tr>
                                                                        </thead>
                                                                    </table>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="panel-body" style="margin-top:-40px">
                            <h4 class="example-title">数据查询</h4>
                            <div class="row">
                                <div class="form-group col-sm-4">
                                    <label class="control-label" for="inputBasicPassword">开始时间</label>
                                    <input type="text" class="form-control empty" autocomplete="off" data-date-format="yyyy-mm-dd" name="" id="kaishishijian" data-plugin="datepicker" data-language="zh-CN" placeholder="请输入成立时间" />
                                </div>
                                <div class="form-group col-sm-4">
                                    <label class="control-label" for="inputBasicPassword">结束时间</label>
                                    <input type="text" class="form-control empty" autocomplete="off" data-date-format="yyyy-mm-dd" name="" id="jieshushijian" data-plugin="datepicker" data-language="zh-CN" placeholder="请输入成立时间" />
                                </div>
                                <div class="form-group col-sm-2" style="padding-top:27px">
                                    <button type="button" id="bt_ChaXun" class="btn btn-block btn-success" style="width: 95%; float: left;" onclick="chakan()"><i class="icon wb-search"></i>查询</button>
                                </div>
                                <div class="form-group col-sm-2" style="padding-top:27px">
                                    <button typeutton" id="bt_ChongZhi" class="btn btn-outline btn-success" style="width: 95%;" onclick="chongzhi();">重置</button>
                                </div>
                            </div>
                        </div>
                        <div class="panel-body" style="margin-top:-50px">
                            <table class="table table-bordered table-hover dataTable table-striped w-full text-nowrap" id="dataTableExample" data-plugin="dataTable" style="text-align:center">
                                <thead>
                                    <tr>
                                        <th>客户名称</th>
                                        <th>联系方式</th>
                                        <th>性别</th>
                                        <th>年龄</th>
                                        <th>意向等级</th>
                                        <th>意向户型</th>
                                        <th>意向金额</th>
                                        <th>状态</th>
                                    </tr>
                                </thead>
                                <tfoot>
                                    <tr>
                                        <th>客户名称</th>
                                        <th>联系方式</th>
                                        <th>性别</th>
                                        <th>年龄</th>
                                        <th>意向等级</th>
                                        <th>意向户型</th>
                                        <th>意向金额</th>
                                        <th>状态</th>
                                    </tr>
                                </tfoot>
                                <tbody></tbody>
                            </table>
                        </div>
                    </div>
                </div>

                <div class="col-md-6" name="lingdao" style="display: none">
                    <div class="panel">
                        <div class="page-header">
                        </div>
                        <div class="panel-body" style="margin-top:-20px">
                            <h4 class="example-title">数据查询</h4>
                            <div class="row">
                                <div class="form-group col-sm-4">
                                    <label class="control-label" for="inputBasicPassword">开始时间</label>
                                    <input type="text" class="form-control empty" autocomplete="off" data-date-format="yyyy-mm-dd" name="" id="zhanduikaishishijian" data-plugin="datepicker" data-language="zh-CN" placeholder="请输入成立时间" />
                                </div>
                                <div class="form-group col-sm-4">
                                    <label class="control-label" for="inputBasicPassword">结束时间</label>
                                    <input type="text" class="form-control empty" autocomplete="off" data-date-format="yyyy-mm-dd" name="" id="zhanduijieshushijian" data-plugin="datepicker" data-language="zh-CN" placeholder="请输入成立时间" />
                                </div>
                                <div class="form-group col-sm-2" id="zongjianchaxushu" style="padding-top:27px;display:none">
                                    <button type="button" class="btn btn-block btn-success" style="width: 95%; float: left;" onclick="zhongjianchaxue('查')"><i class="icon wb-search"></i>查询</button>
                                </div>
                                <div class="form-group col-sm-2" id="jinglichaxushu" style="padding-top:27px;display:none">
                                    <button type="button" class="btn btn-block btn-success" style="width: 95%; float: left;" onclick="jinglichaxue('查')"><i class="icon wb-search"></i>查询</button>
                                </div>
                                <div class="form-group col-sm-2" id="zongjiancz" style="padding-top:27px;display:none">
                                    <button typeutton" id="bt_ChongZhi" class="btn btn-outline btn-success" style="width: 95%;" onclick="zhongjianchongzhi();">重置</button>
                                </div>
                                <div class="form-group col-sm-2" id="jingliancz" style="padding-top:27px;display:none">
                                    <button typeutton" id="bt_ChongZhi" class="btn btn-outline btn-success" style="width: 95%;" onclick="zhanduichongzhi();">重置</button>
                                </div>
                            </div>
                        </div>
                        <div class="panel-body container-fluid" style="margin-top: -40px;">
                            <div class="row row-lg">
                                <div class="col-xl-12">
                                    <div class="example-wrap m-lg-0">
                                        <div class="nav-tabs-horizontal" data-approve="nav-tabs">
                                            <div class="tab-content pt-20" style="margin-top: -40px;">
                                                <div class="tab-pane active" id="exampleTabsLineTwo" role="tabpanel">
                                                    <div class="row row-lg">
                                                        <div class="col-md-12">
                                                            <div class="example-wrap">
                                                                <div class="example table-responsive">
                                                                    <table class="table table-bordered table-hover" style="width: 100%; text-align: center; margin-bottom: 0px;">
                                                                        <thead>
                                                                            <tr>
                                                                                <th colspan="4" style="text-align: center; font-size: 18px;" id="mingcheng">销&nbsp;售&nbsp;信&nbsp;息</th>
                                                                            </tr>
                                                                            <tr>
                                                                                <th>客户量</th>
                                                                                <td>
                                                                                    <div id="zhanduizongkehuliang"></div>
                                                                                </td>
                                                                                <th>
                                                                                    带看量
                                                                                </th>
                                                                                <td>
                                                                                    <div id="zhanduizongdaikanliang"></div>
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <th>成交套数</th>
                                                                                <td>
                                                                                    <div id="zhanduizongchengjiaoshu"></div>
                                                                                </td>
                                                                                <th>
                                                                                    销售额
                                                                                </th>
                                                                                <td>
                                                                                    <div id="zhanduizongxiaoshouer"></div>
                                                                                </td>
                                                                            </tr>
                                                                        </thead>
                                                                    </table>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<input type="text" hidden="hidden" id="renyuanid" />
<input type="text" hidden="hidden" id="xingjishu" value="0" />
<script>
    $(document).ready(function () {
        var shu = getQuery("id");
        $("#renyuanid").val(shu);
        ShuJuChaXu();
        bang('不查');
        chaxuxiaoshoushuju('不查');
        zongchaxu();
        dangqianxingjie();
        xingjishijian();
    });

    function xingjiecchu(xingji) {
        $("#xingjishu").val(xingji);
    }

    function ChongZhiXingJi() {
        $("#xingjishu").val(0);
        $('#rate0-0').attr('checked', 'checked');
        $('#rate0-0').removeAttr("checked");
    }


    function dangqianxingjie() {
        var id = $("#renyuanid").val();
        $.ajax({
            url: "../RenYuan/GetXingJi",
            data: { RenYuanId: id },
            type: "post",
            dataType: "text",
            success: function (date) {
                if (date == "1") {
                    $('#rate1-1').attr('checked', 'checked');
                } else if (date == "2") {
                    $('#rate2-1').attr('checked', 'checked');
                } else if (date == "3") {
                    $('#rate3-1').attr('checked', 'checked');
                } else if (date == "4") {
                    $('#rate4-1').attr('checked', 'checked');
                } else if (date == "5") {
                    $('#rate5-1').attr('checked', 'checked');
                }
                $("#xingjishu").val(date);
            }
        });
    }

    function baocuen() {
        var shuju = $("#xingjishu").val();
        var id = $("#renyuanid").val();
        $.ajax({
            url: "../RenYuan/AddXingJi",
            data: { RenYuanId: id, xingji: shuju },
            type: "post",
            dataType: "text",
            success: function (date) {
                if (date == "true") {
                    $('#baocuenshuju').attr('disabled', "true");
                    alert("保存成功");
                } else {
                    alert("保存失败");
                }
            }
        });
    }

    function xingjishijian() {
        var id = $("#renyuanid").val();
        $.ajax({
            url: "../RenYuan/GetXingJiShiJian",
            data: { RenYuanId: id },
            type: "post",
            dataType: "text",
            success: function (date) {
                if (date == "true") {

                } else {
                    $('#baocuenshuju').attr('disabled', "true");
                }
            }
        });
    }

    function chongzhi() {
        $("#kaishishijian").val('');
        $("#jieshushijian").val('');
        bang('不查')
        chaxuxiaoshoushuju('不查');
    }
    function chakan() {
        $("#nb").removeAttr("hidden","");
        bang('查')
        chaxuxiaoshoushuju('查');
        $("#nb").attr("hidden", "");
    }

    function zongchaxu() {
        var id = $("#renyuanid").val();
        $.ajax({
            url: "../RenYuan/GetZongXiaoShouShuJu",
            data: { RenYuanId: id },
            type: "post",
            dataType: "json",
            success: function (date) {
                $(date).each(function (key) {
                    $("#zongkehuliang").text(date[key].kehuliang);
                    $("#zongdaikanliang").text(date[key].daikanshu);
                    $("#Benchengjiaoshu").text(date[key].chengjiaoshu);
                    $("#Benxiaoshouer").text(date[key].jiner);
                })
            }
        });
    }

    function chaxuxiaoshoushuju(panduan) {
        var kaishishijian = "";
        var jieshushijian = "";
        if (panduan == "查") {
            kaishishijian = $("#kaishishijian").val();
            jieshushijian = $("#jieshushijian").val();
        } else if (panduan == "不查") {
            var kaishishijian = "";
            var jieshushijian = "";
        }
        var id = $("#renyuanid").val();
        $.ajax({
            url: "../RenYuan/GetXiaoShouShuJu",
            data: { RenYuanId: id, kaishishijian: kaishishijian, jieshushijian: jieshushijian },
            type: "post",
            dataType: "json",
            success: function (date) {
                $(date).each(function (key) {
                    $("#Benkehuliang").text(date[key].kehuliang);
                    $("#Bendaikanliang").text(date[key].daikanshu);
                    $("#Benchengjiaoshu").text(date[key].chengjiaoshu);
                    $("#Benxiaoshouer").text(date[key].jiner);
                })
            }
        });
    }

    function bang(panduan) {
        var kaishishijian = "";
        var jieshushijian = "";
        if (panduan == "查") {
            kaishishijian = $("#kaishishijian").val();
            jieshushijian = $("#jieshushijian").val();
        } else if (panduan == "不查") {
            var kaishishijian = "";
            var jieshushijian = "";
        }
        var lang = {
            "sProcessing": "大量处理中，请稍后...",
            "sLengthMenu": "每页 _MENU_ 项",
            "sZeroRecords": "没有匹配结果",
            "sInfo": "当前显示第 _START_ 至 _END_ 项，共 _TOTAL_ 项。",
            "sInfoEmpty": "当前显示第 0 至 0 项，共 0 项",
            "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
            "sInfoPostFix": "",
            "sSearch": "搜索:",
            "sUrl": "",
            "sEmptyTable": "表中数据为空",
            "sLoadingRecords": "载入中...",
            "sInfoThousands": ",",
            "oPaginate": {
                "sFirst": "首页",
                "sPrevious": "上页",
                "sNext": "下页",
                "sLast": "末页",
                "sJump": "跳转"
            },
            "oAria": {
                "sSortAscending": ": 以升序排列此列",
                "sSortDescending": ": 以降序排列此列"
            }
        };
        $("#dataTableExample").dataTable().fnDestroy();
        $('#dataTableExample').dataTable({
            "order": [[1, "asc"]],
            "language": lang,
            "processing": true,
            "serverSide": true,
            //"bStateSave": true,//状态保持模式
            "searching": false,//禁用搜索
            ajax: function (data, callback, settings) {
                //封装请求参数
                //console.log(data);
                var param = {};
                param.limit = data.length;//页面显示记录条数，在页面显示每页显示多少项的时候
                param.start = data.start;//开始的记录序号
                param.page = (data.start / data.length) + 1;//当前页码
                param.dir = data.order[0].dir;
                param.column = data.order[0].column;
                param.kaishishijian = kaishishijian;
                param.jieshushijian = jieshushijian;
                param.RenYuanId = $("#renyuanid").val();
                //console.log(param);

                //ajax请求数据
                $.ajax({
                    type: "POST",
                    url: "../RenYuan/GetKehuListshuju",
                    cache: false,  //禁用缓存
                    data: param,  //传入组装的参数
                    dataType: "json",
                    success: function (result) {
                        console.log(result);
                        //setTimeout仅为测试延迟效果
                        setTimeout(function () {
                            //封装返回数据
                            var returnData = {};
                            returnData.draw = data.draw;//这里直接自行返回了draw计数器,应该由后台返回，
                            returnData.recordsTotal = result.total;//返回数据全部记录
                            returnData.recordsFiltered = result.total;//后台不实现过滤功能，每次查询均视作全部结果
                            returnData.data = result.data;//返回的数据列表
                            //console.log(returnData);
                            //调用DataTables提供的callback方法，代表数据已封装完成并传回DataTables进行渲染
                            //此时的数据需确保正确无误，异常判断应在执行此回调前自行处理完毕"orderable" : false
                            callback(returnData);
                        }, 200);
                    }
                });
            },
            "columns": [
                { "data": "KeHuXingMing" },
                { "data": "ShouJiHaoMa" },
                { "data": "XingBie" },
                { "data": "NianLing" },
                { "data": "YiXiangDengJi" },
                { "data": "YiXiangHuXing" },
                { "data": "YiXiangZongJia" },
                { "data": "ZhuangTai" }
            ]
        });
    }

    function ShuJuChaXu() {
        var id = $("#renyuanid").val();
        $.ajax({
            url: "../RenYuan/GetRenYuanXiangXi",
            data: { RenYuanId: id },
            type: "post",
            dataType: "json",
            success: function (date) {
                $(date).each(function (key) {
                    $("#renyuanmingcheng").text(date[key].renyuanmingcheng);
                    $("#xingbie").text(date[key].xingbie);
                    $("#nianling").text(date[key].nianling);
                    $("#lianxifangshi").text(date[key].lianxifangshi);
                    $("#gongsimingcheng").text(date[key].gongsimingcheng);
                    $("#bumenmingcheng").text(date[key].bumenmingcheng);
                    $("#gangweimingcheng").text(date[key].gangweimingcheng);
                    $("#zhanqumingcheng").text(date[key].zhanqumingcheng);
                    $("#zhanduimingcheng").text(date[key].zhanduimingcheng);
                    $("#shoushuzhanquzhong").text(date[key].shoushuzhanquzhong);
                    $("#shoushubumenzongjian").text(date[key].shoushubumenzongjian);
                    $("#ruzhishijian").text(date[key].ruzhishijian);
                    $("#lizhishijian").text(date[key].lizhishijian);
                    if (date[key].gangweimingcheng == "业务员" || date[key].gangweimingcheng == "置业顾问") {

                    } else if (date[key].gangweimingcheng == "储备经理" || date[key].gangweimingcheng == "销售经理") {
                        $("[name='xiaoshi']").css('display', 'none');
                        $("[name='lingdao']").css('display', 'block');
                        $("#jinglichaxushu").css('display', 'block');
                        $("#jingliancz").css('display', 'block');
                        $("#mingcheng").html("当&nbsp;前&nbsp;战&nbsp;队");
                        jinglichaxue('不查');
                    } else if (date[key].gangweimingcheng == "储备总监" || date[key].gangweimingcheng == "战区总监") {
                        $("[name='xiaoshi']").css('display', 'none');
                        $("[name='lingdao']").css('display', 'block');
                        $("#zongjianchaxushu").css('display', 'block');
                        $("#zongjiancz").css('display', 'block');
                        $("#mingcheng").html("当&nbsp;前&nbsp;战&nbsp;区");
                        zhongjianchaxue('不查');
                    } else {
                        $("#daxiaozhanshi").css('class', 'col-md-12');
                        $("[name='xiaoshi']").css('display', 'none');
                    }
                })
            }
        });
    }

    function zhongjianchaxue(zhi) {
        $("#nb").removeAttr("hidden", "");
        
        var kaishishijian = "";
        var jieshushijian = "";
        var id = $("#renyuanid").val();

        if (zhi == '查') {
            kaishishijian = $("#zhanduikaishishijian").val();
            jieshushijian = $("#zhanduijieshushijian").val();
        } else {
            kaishishijian = "";
            jieshushijian = "";
        }
        $.ajax({
            url: "../RenYuan/GetXiaoShouShuJuZongJian",
            data: { RenYuanId: id, kaishishijian: kaishishijian, jieshushijian: jieshushijian },
            type: "post",
            dataType: "json",
            success: function (date) {
                $(date).each(function (key) {
                    $("#zhanduizongkehuliang").text(date[key].kehuliang);
                    $("#zhanduizongdaikanliang").text(date[key].daikanshu);
                    $("#zhanduizongchengjiaoshu").text(date[key].chengjiaoshu);
                    $("#zhanduizongxiaoshouer").text(date[key].jiner);
                })
                $("#nb").attr("hidden", "");
            }
        });
    }

    function jinglichaxue(zhi) {
        $("#nb").removeAttr("hidden", "");
        var kaishishijian = "";
        var jieshushijian = "";
        var id = $("#renyuanid").val();
        if (zhi == '查') {
            kaishishijian = $("#zhanduikaishishijian").val();
            jieshushijian = $("#zhanduijieshushijian").val();
        } else {
            kaishishijian = "";
            jieshushijian = "";
        }
        $.ajax({
            url: "../RenYuan/GetXiaoShouShuJuJingLi",
            data: { RenYuanId: id, kaishishijian: kaishishijian, jieshushijian: jieshushijian },
            type: "post",
            dataType: "json",
            success: function (date) {
                $(date).each(function (key) {
                    $("#zhanduizongkehuliang").text(date[key].kehuliang);
                    $("#zhanduizongdaikanliang").text(date[key].daikanshu);
                    $("#zhanduizongchengjiaoshu").text(date[key].chengjiaoshu);
                    $("#zhanduizongxiaoshouer").text(date[key].jiner);
                })
                $("#nb").attr("hidden", "");
            }
        });
    }

    function zhanduichongzhi() {
        $("#zhanduikaishishijian").val('');
        $("#zhanduijieshushijian").val('');
        jinglichaxue('不查');
    }

    function zhongjianchongzhi() {
        $("#zhanduikaishishijian").val('');
        $("#zhanduijieshushijian").val('');
        zhongjianchaxue('不查');
    }

    function getQuery(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return decodeURI(r[2]); return null;
    }

</script>